import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'  //解决页面刷新store数据丢失问题
import Cookies from 'js-cookie'
import getters from './getters'
import app from './module/app'
import user from './module/user'
import permission from './module/permission'


Vue.use(Vuex)

const store = new Vuex.Store({
    modules: {
        app,
        user,
        permission
    },
    getters,
    /*plugins: [
        createPersistedState({
            storage: window.sessionStorage,
            filter(mutations) {
                console.log(mutations.type)
                /!*if('SET_USER_INFO' === mutations.type) {
                    console.log(mutations.type)
                    return false
                } else {
                    return true
                }
                if('ADD_VISITED_VIEWS' === mutations.type) {
                    return false
                } else {
                    return true
                }*!/
            }
        })
    ]*/
})

export default store
